package com.guguju.ssms.utils;

import android.content.Context;

import com.blankj.utilcode.utils.SPUtils;
import com.guguju.ssms.Guguju;
import com.guguju.ssms.bean.LoginData;
import com.guguju.ssms.constant.SPConstant;

/**
 * Created by dell on 2022-5-15.
 */
public class LoginUtil {
    /**
     * 登录成功
     *
     * @param mContext
     * @param loginData
     */
    public static void loginSuccess(Context mContext, LoginData loginData) {
        if (loginData != null) {
            Guguju.USERID = loginData.getUserId();
            Guguju.AUTH = loginData.getAuth();
            Guguju.ASESSTOKEN = loginData.getAsessToken();

            SPUtils schemeSp = new SPUtils(mContext, SPConstant.SP_XML_NAME);
            schemeSp.putInt(SPConstant.USERID, loginData.getUserId());
            schemeSp.putString(SPConstant.AUTH, loginData.getAuth());
            schemeSp.putString(SPConstant.ASESSTOKEN, loginData.getAsessToken());
        }
    }
}